package com.mspbots.usermanage.security;

import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.RestController;

/**
 * com.mspbots.usermanage.security.AuthController
 *
 * @author Jason
 * @date 2019/12/11
 **/
@Log4j2
@RestController
public class AuthController {
/*

    @Autowired
    private AuthService authService;

    @GetMapping(path = "oauth")
    public Mono<Map> oauth(AbstractAuthenticationToken principal, WebSession webSession) {
        return this.authService.oauth(principal.getName()).map(m -> { m.put("token", webSession.getId());return m; });
    }

    @PostMapping(path = "chang-password")
    public Mono changPassword(@RequestBody ChangePasswordDTO changePasswordDTO) {
        Assert.notNull(changePasswordDTO.getPassword(), () -> "The current password cannot be empty.");
        Assert.notNull(changePasswordDTO.getNewPassword(), () -> "The newPassword cannot be empty.");
        return this.authService.changePassword(changePasswordDTO);
    }

//    @PostMapping(path = "register")
//    public Mono register(@RequestBody UserParam request) {
//        request.setRoles(List.of(DEFAULT_TENANT_ADMIN_ROLE_NAME, DEFAULT_TENANT_USER_ROLE_NAME));
//        return this.authService.register(request);
//    }

    @GetMapping(path = "/sso/teams/{teamsId}")
    public Mono ssoTeamsLogin(@PathVariable String teamsId, ServerWebExchange exchange) {
        return this.authService.teamsLogin(teamsId, exchange);
    }


//    @PostMapping(path = "change/user")
//    public Mono changeUser(@RequestBody UserParam request) {
//        return this.authService.changeUser(request);
//    }
*/

}
